@use '@scss/common' as *;

.creditCardList {
  position: relative;
}

.scrollRef {
  position: absolute;
  top: -6rem;
}

.error {
  color: var(--theme-error-500);
}

.success {
  color: var(--theme-success-500);
}

.formState {
  display: flex;
  flex-direction: column;
  gap: 1rem;

  > * {
    margin: 0;

    &:last-child {
      margin-bottom: 1rem;
    }
  }
}

.cardState {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-bottom: 0.5rem;

  > * {
    margin: 0;
  }
}

.cards {
  display: flex;
  flex-direction: column;
  gap: 1rem;

  @include mid-break {
    gap: 0.5rem;
  }
}

.card,
.newCard {
  border: 0.5px solid;
  border-color: var(--theme-border-color);
  padding: 1rem;
  display: flex;
  align-items: center;
  gap: 1rem;

  > * {
    margin: 0;
  }

  @include mid-break {
    padding: 0.75rem;
  }
}

.newCard {
  flex-grow: 1;
  border-color: var(--theme-success-500);

  > * {
    width: 100%;
  }
}

.cardBrand {
  flex-grow: 1;
  line-height: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.deleteCard,
.makeDefault {
  background-color: transparent;
  border: 0;
  margin: 0;
  padding: 0;
  line-height: inherit;
  font-size: inherit;
  font-family: inherit;
  outline: none;

  &:hover {
    cursor: pointer;
    text-decoration: underline;
  }
}

.controls {
  display: flex;
  align-items: center;
  margin-top: 1rem;
  gap: 1rem;
}

.saveNewCard,
.cancelNewCard {
  background-color: transparent;
  margin: 0;
  padding: 0;
  border: none;
  line-height: inherit;
  font-family: inherit;
  cursor: pointer;
  font-size: inherit;
}

.cancelNewCard {
  color: var(--theme-elevation-500);
}

.modalActions {
  display: flex;
  gap: 1rem;
  justify-content: flex-end;
  width: 100%;
  padding-top: 1rem;
  border-top: 0.5px solid var(--theme-border-color);
}
